//文件测试

import java.io.*;
public class FileTest {
    public static void main(String[] args)
    {
        if(args.length > 0)
        {
            for(int i=0;i<args.length;i++)
            {
                File file_test = new File(args[i]);
                info(file_test);
            }
        }
        else
        {
            System.out.println("No file given");
        }
    }

    public static void info(File f)
    {
        try{
            if(f.exists())
            {
                System.out.println(f.getName() + "exists");
                System.out.println("last modified:" + f.lastModified());
                System.out.println("Length:" + f.length());
                System.out.println("Path: " + f.getPath() );
                System.out.println("Absolute path: " +  f.getAbsolutePath());
                System.out.println("Parent: " + f.getParent() );  
                System.out.println(" Can  Write: " + f.canWrite() );  
            }
            else{
                System.out.println("File does not exist");
            }
        }
        catch(Exception e)
        {
            System.out.println(e.toString());
        }
    }
}